<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background:red;
            margin-bottom:10px;
        }
    </style>
    <script src="jquery-3.2.0.min.js"></script>
    <script>
       $(function(){
           $('#box').click(
                   function(){
                       $('#box').attr({
                           title:'哈哈哈哈哈哈哈',
                           class:'xxx'
                       })
                   }
           )
       })
    </script>
</head>
<body>
<input type="button" value="哈哈哈" id="box">
<input type="text">
<ul>
    <li>1</li>
    <li>3</li>
    <li>4</li>
</ul>
</body>
</html>